home *** CD-ROM | disk | FTP | other *** search
/ Mac100% 1998 November / MAC100-1998-11.ISO.7z / MAC100-1998-11.ISO / オンラインソフト定点観測 / テキスト / Torquemada 1.3.1.sit / GST-TorqueDemo / Torquemada Explained / Torquemanual < prev    next >
Text File  |  1998-08-01  |  82KB  |  1,892 lines

  1.  
  2.  
  3.  
  4.  
  5. A Torquemanual for the Inquisitive
  6.  
  7.  
  8.  
  9.  
  10. Documenting Torquemada version 1.3.1, ゥ 1998 by Greg Swann
  11.  
  12.  
  13. 8/1/98
  14.  
  15. Greg Swann
  16.  
  17. gswann@kagi.com
  18. gswann@primenet.com
  19.  
  20. USPS: 3608 West Cochise Drive
  21.       Phoenix, AZ 85051
  22.  
  23.  
  24.  
  25.  
  26. Table of Contents
  27.  
  28. 0. Introductory Chatter
  29.  
  30. 1. Torquemada Basics
  31.  
  32. 2. String Literals
  33.  
  34. 3. Aliases
  35.  
  36. 4. Case Conversion
  37.  
  38. 5. Untyped Wildcards
  39.  
  40. 6. Typed Wildcards
  41.  
  42. 7. The Do-It-Yourself Wildcard
  43.  
  44. 8. Wildstrings
  45.  
  46. 9. The Wildstring Modifier
  47.  
  48. 10. Torquemada's Ghost
  49.  
  50. 11. Putting It All Together
  51.  
  52. 12. Bringing It All Back Home
  53.  
  54.  
  55.  
  56. 0. Introductory Chatter
  57.  
  58. This is kind of a funny little Ugly Duckling story. Torquemada the
  59. Inquisitor started life as a fluffy little bit of nothingstuff with
  60. a Mac interface wrapped around it. When we were testing XP8, Garry
  61. Fairbairn (the Argus of Saskatoon) had asked me to come up with a
  62. search and replace engine that he could use to translate American
  63. spellings to those favored by people more recently divorced from the
  64. Crown. I came home one night and spent two minutes writing a little
  65. toy that traded massive quantities of memory for very, very fast
  66. searches. That little core was the basis of the first Torquemada.
  67.  
  68. Torquemada 1.0.0 worked only on string literals. It sported no
  69. wildcards. It read only only one line at a time. But it was very,
  70. very fast...
  71.  
  72. We've been through twelve versions since then. Along the way, the
  73. search engine has been replaced twice, making it somewhat slower but
  74. a lot less hungry for memory. The read/write code has been replaced
  75. three times. The interface has been (transparently) overhauled. And
  76. somewhere in there, I began to take it seriously... (grin)
  77.  
  78. The current release, version 1.3.1, can deploy a infinite number of
  79. search and replace strings on up to 256 files in a drag and drop
  80. batch, and the searches can employ up to 29 wildthings of various
  81. stripes ("wildthings" are Torquemada's multifaceted wildcards; there
  82. will be _much_ more about these in due course). And it is still
  83. very, very fast...
  84.  
  85. And this is very far from the end of the story. But it is the end
  86. for now, which makes this the appropriate place to fully document
  87. the software as it now stands.
  88.  
  89.  
  90. Commercial, legal and other pertinent notices:
  91.  
  92. XP8, mentioned above, is a text file reformatter. It will clean up
  93. and make QuarkXPress-ready Macintosh or DOS text files. Among many
  94. other features, it intelligently reformats paragraphs, converts the
  95. DOS or WordStar character sets to their Mac equivalents,
  96. substantially improves the hyphenation and justification of text,
  97. converts quotes better than any software currently available, and
  98. traps for XPress Tags errors that might otherwise result in missing
  99. text or irreversible document corruption. A demo version of XP8 is
  100. available on CompuServe (GO DTPFORUM, Library 5) or in the Info-Mac
  101. archives (as GST-XP8Demo.sit).
  102.  
  103. This archive contains full or demo versions of Torquemada the
  104. Inquisitor and Torquemada's Ghost, a scriptable, backgroundable
  105. version of Torquemada. The demo versions will permit up to 32
  106. launches and then forevermore refuse to do anything but be an
  107. automated salesman. They are _fully functional_ demos. Nothing is
  108. crippled, and everything works exactly as documented here. The only
  109. inhibition is the one named: 32 launches, max.
  110.  
  111. All of these programs are sold on the same terms: (US)$50 each, per
  112. license. Two to 10 licenses are $45 each. For 11 or more licenses
  113. you're better off buying a site license. Information on registering
  114. for the full releases of Torquemada and XP8, plus my other
  115. commercial releases, can be found in the registration software
  116. enclosed.
  117.  
  118. Torquemada the Inquisitor, Torquemada's Ghost, their source and
  119. executable code, and this poor excuse for a manual are Copyright (C)
  120. 1998 by Greg Swann. All rights are most emphatically reserved.
  121.  
  122. Torquemada is licensed for use on one machine by the person who paid
  123. for it. If you didn't pay for it, please do! I am one person, with a
  124. long-suffering family, not Conglomerated MegaSoft (not to imply that
  125. there's any virtue in ripping _them_ off!).
  126.  
  127. Torquemada is delivered "as is", without any warranties, expressed
  128. or implied. It is not warranted to be useful _to_ anyone, _for_
  129. anything, and in no wise am I to be held responsible for any
  130. unfortunate consequences resulting from its use or misuse. And I
  131. _hate_ having to say things like that. I do my best to write useful,
  132. simple, elegant, bug-free solutions to difficult problems. If you
  133. take it into your head that I represent your big chance to 'strike
  134. it rich,' you will pay a lot in legal fees to discover that you have
  135. miscalculated.
  136.  
  137. And: to those to whom the above disclaimer does not apply: forgive
  138. me for having to make it. It's _you_ whom I'm working for, for pay
  139. or for free. I appreciate your custom and your support, and I wish
  140. we all could just comb the others out of our hair...
  141.  
  142. (Hey, it's a real 'personal' software company! (grin))
  143.  
  144.  
  145. Some notes at random:
  146.  
  147. While XP8 is a QuarkXPress-specific program, Torquemada can be used
  148. with any Macintosh software that can read and write files of type
  149. TEXT (plain text files). For that reason, this manual is produced as
  150. a plain text file. I would much prefer to write it as an XPress
  151. file, but that wouldn't be terribly useful to people using
  152. PageMaker, ReadySetGo! or FrameMaker. For ease of use with a variety
  153. of text editors, this file is produced in DOS-like fashion; each
  154. line ends with a carriage return. Ideally, you should read it and
  155. print it out in a monospaced font such as Courier, since in certain
  156. places things are aligned with spaces. And: where a certain
  157. keystroke might be ambiguous, I am naming it in words enclosed in
  158. braces; for example, {space} means the spacebar character.
  159.  
  160. In the same neighborhood, because I myself am an XPress user, and
  161. because my own uses for Torquemada are focused on Quark, my examples
  162. tend to be intensely Quark-like. This is a side-effect that will
  163. have to be overcome by users of other software. Reasoning by
  164. analogy, you will be able to see how to apply my examples to similar
  165. features in your software of choice.
  166.  
  167. To make the best use of this software (and of XP8, for that matter),
  168. you need some type of fairly functional text editor/word processor.
  169. I use Word or BBEdit, a freeware programmer's editor. The latter is
  170. highly recommended for our purposes.
  171.  
  172. As mentioned above, Torquemada owes its origins to some
  173. exceptionally literate caterwauling by Garry Fairbairn. Its further
  174. development was goaded in good measure by some very compelling
  175. growling by Shane Stanley (who has a unique perspective on things
  176. due to his insistence on living upside down in an entirely different
  177. day). Along the way, a number of other users made valid, valuable
  178. suggestions, and I'm sure that will continue to be the case. More
  179. than any other piece of software by me, Torquemada has been
  180. influenced by its users, and, here, at the outset, I want to
  181. encourage you to contact me with any requests or suggestions you
  182. have.
  183.  
  184. The default "Torquemada Prefs" file shipped with this disk pays
  185. homage to the 20 brave souls who lent their diligence and
  186. intelligence to the XP8 beta-testing process. Despite my gentle
  187. ribbing, they have my gratitude and my highest respect.
  188.  
  189. Mike Arst (inventor of the Kvetchamatic Irregular Expression Parser)
  190. had a profound and lasting impact on this document. Obviously, any
  191. remaining errors or ambiguities are my responsibility; he takes
  192. credit only for the stuff that is clear, grammatically correct, and
  193. spelled properly in languages currently in use by humans. Seriously:
  194. he has a rare talent for inducing a tabula rasa mental state (this
  195. may not be a compliment!), such that he can spot hand-waving or other
  196. logical elisions better than anyone I know. It was he who forced me
  197. to write the (to me tedious) descriptions of what each and every
  198. command means. If you are a software developer, you are well-advised
  199. to pay Mike whatever he asks to critique your documentation. He can
  200. be reached at mikea@halcycon.com or by USPS at:
  201.  
  202. Mike Arst
  203. 2459 Fifth Avenue West
  204. Seattle, WA 98119-2506
  205.  
  206. Perhaps because of its democratic roots (how odd for a program named
  207. after an autocrat), Torquemada the Inquisitor has sprouted a great
  208. host of nicknames. I tend to call things by (quasi-)acronym, so he's
  209. TQM to me. From the very beginning he was Torque or Tork to others,
  210. and these gave rise to verb forms: I Torque, you were Torking, they
  211. had Torqued.
  212.  
  213. And, for reference: Tomas de Torquemada was the First Grand
  214. Inquisitor of the Spanish Inquisition. The name was later adopted as
  215. a nom de guerre by the first editor of the Observer of London
  216. Crossword Puzzle, and I probably would not have used it were it not
  217. for that latter association.
  218.  
  219.  
  220.  
  221. 1. Torquemada Basics
  222.  
  223. Torquemada is: 32-bit clean, System 7 compatible, Multi-Finder eager,
  224. kind to children and house pets, and safe for use on your precious
  225. hardwood floors. The companion software, Torquemada's Ghost, is
  226. AppleEvent aware and is designed specifically to be used with
  227. AppleScript or Frontier scripts.
  228.  
  229. Torquemada will run on any Mac from the Plus up. It requires 768K of
  230. RAM, and you are cautioned not to set the partition smaller than
  231. this; we're using it all.
  232.  
  233. The interface consists of two dialog boxes and two help windows, and
  234. all of these are very straightforward in operation. If you can use a
  235. Mac at all, you can use my boy Torque.
  236.  
  237. The Pyre of Purification dialog box uses 10 point Helvetica. If you
  238. don't have that bitmap loaded, you will need to load it into either
  239. your System file or your Core Fonts suitcase. If you don't,
  240. Torquemada will still work, but the search and replace strings will
  241. be hard to read.
  242.  
  243. And: when your files are being processed, Torque displays the stylish
  244. and attractive Movado Museum Watch Cursor to let you know that things
  245. are really happening.
  246.  
  247. TQM reads files of type 'TEXT'. It will also see files with the
  248. creator types 'text', 'MDOS', 'mdos', 'CRLF' and 'crlf'. These latter
  249. types are supported because some third-party products have very odd
  250. ideas about how to treat 'TEXT' files.
  251.  
  252. Torquemada writes files of type 'TEXT' (with the creator type
  253. 'XP84'). These files can be opened from any application that can read
  254. plain text files. They can be processed directly by XP8 or other
  255. utilities of mine. Or they can be imported directly into QuarkXPress,
  256. PageMaker or any other publishing application with a plain- or
  257. smart-ASCII filter.
  258.  
  259. You write your search and replace strings into the Pyre of
  260. Purification dialog box. Searches go on the left and replaces on the
  261. right. Space is allotted for up to 20 search and replace strings, and
  262. precious little space is left on a nine-inch screen! Torquemada
  263. search and replace strings have an enormous maximum length (254
  264. characters). The normal Macintosh text editing services are available
  265. in the Pyre, along with Select All, Copy, Cut, Paste and Clear. You
  266. can Copy from your text editor and Paste into the Pyre, which is the
  267. fastest way to write search strings.
  268.  
  269. The Inquisitor reads and writes sets of search and replace strings.
  270. This is valuable: in many cases, you need to perform the same searches
  271. on the same types of files, week in and week out. Once you have
  272. perfected a set of searches, you can save it for reuse. Through the
  273. Open Set button in the Pyre of Purification dialog box, Torquemada
  274. will read set files having the creator type 'PREF'. It will also 'see'
  275. the types 'pref', 'TEXT', 'text', 'CRLF' and 'crlf'. These latter
  276. types are supported so that, if you want, you can write sets in your
  277. word processor. A TQM set saved from the Pyre of Purification consists
  278. of 40 plain text lines in the form of search, replace, search,
  279. replace, etc. When you hit the Save Set button in the dialog, the
  280. software will write the currently active set to a file of type
  281. 'PREF'.
  282.  
  283. Note: if you don't intend to edit a set in the Pyre of Purification, it
  284. can have an infinite number of search and replace strings. Also, a set
  285. file can use any number of tabs as the delimiter between the search
  286. and replace string. The reason is to permit easy editing of set files
  287. in a text editor or word processor. Open the set file called "A Legal
  288. Set File" from a text editor or word processor to see how this looks
  289. in real life. Torquemada continues to Save sets using CR as the
  290. delimiter. Be careful Pasting into WP docs; TQM filters tabs and
  291. returns before he saves, but you'll need to do this manually after you
  292. Paste. The Pyre of Purification will only edit files consisting of 20
  293. search and replace strings. If you attempt to edit a set containing
  294. more than 20 pairs of strings, you will get an ALRT inviting you to
  295. Cancel! or Truncate the set.
  296.  
  297. If you have one basic set of searches that you frequently need to
  298. run, you can save it under the name "Torquemada Prefs" and store it
  299. in the same folder where TQM resides. When you launch the software
  300. directly, this set will load automatically.
  301.  
  302. Alternatively, you can launch Torquemada by double-clicking on a set,
  303. by selecting it and doing a Finder Open, or (under System 7) by
  304. dragging the set onto the application's icon or an alias of it.
  305. Torque will launch and the set you selected will be loaded instead of
  306. Torquemada Prefs. For this to work, the set must have the creator
  307. type 'PREF'.
  308.  
  309. You can select up to 32 sets (of type 'PREF') in this fashion, and the
  310. sets will be processed in alphabetical order on your text files. These
  311. sets will persist until you either Quit, Open Set, Save Set or Clear
  312. All. After you do any of the latter three, only the set visible in the
  313. Pyre of Purification will be run on your text.
  314.  
  315. IMPORTANT: Torquemada's Ghost processes set files in the order
  316. received, not in alphabetical order. See the section on Torquemada's
  317. Ghost for a fuller discussion of this important difference.
  318.  
  319. Under System 7, you can select up to 256 text files and drag and drop
  320. them onto the application's icon or an alias of it. At the same time,
  321. you can drag and drop up to 32 sets (of type 'PREF'). If you do not
  322. select any sets, Torquemada Prefs will be run on your batch of files.
  323. If you do select one or more sets, those sets will be run in
  324. alphabetical order on each of your files.
  325.  
  326. To make this clear:
  327.  
  328. You can use the standard file interface to Open Sets and Open and
  329. Save files; or,
  330.  
  331. You can select a number of sets in the finder and use the standard
  332. file interface to have those sets run in alphabetical order on each
  333. file Opened; or,
  334.  
  335. Under System 7, you can select a number of sets and a number of files
  336. and drag and drop them all on Torque. Each file will be run against
  337. all the sets. 
  338.  
  339.  
  340. Not for nerds only:
  341.  
  342. 'Alphabetical order' is serious business. The 'natural' order is the
  343. order selected (clicked upon) in the Finder. That's hard to remember,
  344. and it's hard to predict the effects of multiple file selection done
  345. by dragging out a marquee. So: we're sorting to lexical order: A
  346. comes before Z, which comes before a, which comes before z. The files
  347. 'Today', 'TODAY', and 'today' would sort to:
  348.  
  349. TODAY
  350. Today
  351. today
  352.  
  353. O comes before o, and T comes before t. If you need to know how sets
  354. will sort, just look at an ASCII chart. Better yet, name your sets
  355. with numbers; use two digits (02, not 2), since 10 comes before 2.
  356.  
  357. Why are we sorting sets? A batch of sets is a 'virtual' set. The
  358. second search in a single set can operate on the results of the first
  359. search. In the same way, the first search in the second set of a
  360. batch can operate on something left behind by the first set. To use
  361. batches of sets reliably, you have to know the exact order in which
  362. the searches will be made. Sorting the sets gives you greater
  363. control.
  364.  
  365. REMEMBER: Torquemada's Ghost processes set files in the order received,
  366. not in alphabetical order.
  367.  
  368. Why are the file limits set so high? Because I hate to think that
  369. anything I do is _almost_ good enough. Honestly, if ever you find
  370. yourself running hundreds of searches, examine your methods to see if
  371. they can be made more general. If ever you find yourself running on a
  372. batch of 256 files, query your source to see if they can tighten up on
  373. their end a bit. But: if you really _do_ need awesome quantities of
  374. strings or files, you've got 'em.
  375.  
  376. Batch-processed files will have the default extension (.TQM) applied
  377. to them automatically. If a source file has already been Torqued, and
  378. if its name is _exactly_ 31 characters in length, the new name would
  379. be identical to the old. In that one case, we are using a slightly
  380. different extension (.TQオ), so as to avoid toasting the source file.
  381.  
  382. Logic of Beeps: if you run a batch of files, Torquemada will beep at
  383. you, a cheery little, "Hey, Dufus! Wake up!" TQM also beeps at the
  384. end of any _normal_ run that takes longer than 5 seconds.
  385.  
  386.  
  387. Nuts and bolts:
  388.  
  389. Torquemada reads and writes by the buffer-load. At read time, a
  390. buffer is approximately 16K in size, and space is allocated for a
  391. buffer to quadruple in size during processing. Torque can read around
  392. returns _because_ it is working on these enormous buffers. At the
  393. same time, we divide between buffers intelligently, so as to avoid
  394. missing any searches.
  395.  
  396. At the time that a new buffer is assembled, a check is run against
  397. the end of the buffer. If any of the search strings are present in
  398. the end of the buffer, the buffer is truncated at the start of the
  399. earliest full match. The remainder is prepended to the next buffer.
  400.  
  401. Each search string is run against the whole buffer _as it is at the
  402. time of the search._ Consequently, later searches can operate on the
  403. results of earlier replaces. This proves useful on a number of
  404. grounds, as we will see in due course. But it is also grounds for a
  405. certain amount of caution.
  406.  
  407. The buffer truncation mentioned above can only happen with strings
  408. that represent the literal contents of the source file at read time.
  409. So if a later search needs to find something put in by an earlier
  410. replace, that earlier search needs to include everything expected by
  411. the later search. As an example, this could fail ("^p" is a Torquemada
  412. 'alias' that denotes the carriage return character):
  413.  
  414. SEARCH STRING   REPLACE STRING
  415. -------------   --------------
  416. ^pGreg          ^p<B>Greg<B>
  417. ^p^p<B>Greg<B>  ^p^p<BI>Greg<BI>
  418.  
  419. It could fail because the first search doesn't require Torquemada to
  420. preserve both returns in the same buffer. In a very large file, with
  421. a large number of chances to fail, some few can slip through the
  422. cracks. The solution is simple: specify everything you'll need to see
  423. in search strings that reflect the actual contents of the file:
  424.  
  425. ^p^pGreg        ^p^p<B>Greg<B>
  426. ^p^p<B>Greg<B>  ^p^p<BI>Greg<BI>
  427.  
  428. Torquemada uses 29 characters in low ASCII for its own storage
  429. purposes; all of the various wildthings are flagged with these codes.
  430. In consequence, the software needs to insulate any low ASCII characters
  431. found in the source. Otherwise, they would look like wildthings during
  432. searches. So at read time, Torquemada is converting low ASCII found in
  433. the source to a relatively harmless form, e.g. <¥#008>. ASCII 1 though
  434. 8, 11, 12, and 14 through 29 are handled this way.
  435.  
  436. ASCII 10 (the linefeed) is handled with a certain measure of
  437. intelligence. The linefeed is the poor relation among control
  438. characters. It had a great day in the sun on Unix systems, where its
  439. use is analogous to the carriage return on the Mac. On DOS systems,
  440. it is an entirely redundant siamese twin to the carriage return. And
  441. on Macs, the poor little linefeed isn't used at all. So: if
  442. Torquemada finds himself processing a Unix file, he will convert the
  443. linefeeds to carriage returns. Linefeeds in DOS files are thrown away
  444. with malice aforethought.
  445.  
  446. ASCII 9 and 13 (Tab and Return) are not converted.
  447.  
  448. ASCII 30 is used by Word to denote non-breaking words, so we're
  449. converting that to <¥h>, the XPress Tags-language mnemonic for "don't
  450. hyphenate". And Word uses ASCII 31 for the non-breaking hyphen, so
  451. we're showing that as <¥!#45>, XPress Tags for a non-breaking hyphen.
  452. All of these conversions happen before any searches are run, so you
  453. can search for the rare instance of low ASCII by using these codes.
  454.  
  455. On the way _out_ (as the new files is being written to disk) all
  456. instances of the QuarkXPress literal code XPress Tag (e.g., "<¥#000>")
  457. will be converted to their actual ASCII value. This is implemented as
  458. a post-process (i.e., after all searches are complete), so it is
  459. possible to search for and act upon any tagged literal codes. Files
  460. processed in this way can be run through Torquemada again
  461. transparently, with the stipulations discussed above: ASCII 30 and 31
  462. are permanently converted to <¥h> and <¥#45>, and LF (ASCII 10) is
  463. always thrown away. If you introduce an LF into a file, be sure to
  464. reintroduce it in subsequent uses of Torquemada.
  465.  
  466.  
  467. User interface notes...
  468.  
  469. Torquemada 1.3.1 implements a number of new interface features. If
  470. you're new to the software, follow along. But if you're not, follow
  471. along _closely_. A _lot_ has changed.
  472.  
  473. First, when Torquemada is launched with a drag and drop batch of TEXT
  474. files, it will quit automatically at the end of the batch. Drag &
  475. drop batches of set files only will be handled as before, as will
  476. double-click launches.
  477.  
  478. All of Torquemada's menu commands and buttons can be accessed via
  479. keyboard equivalents. For example, the Wildcards scorecard can be had
  480. with CMD-? from either dialog.
  481.  
  482. Any window or dialog with a close box can be closed with CMD-W.
  483.  
  484. In the Pyre of Purification (Strings) dialog, CMD-S will do a Save of
  485. any _named_ file. If a file has not been named, that is, if the
  486. program was launched by a double-click on its icon, Torquemada will do
  487. a Save As instead. If you double-click on, drag and drop, or Open a
  488. set, that is the set that will be Saved, and its name will appear in
  489. the title bar of the dialog. If you double-click on or drag and drop
  490. multiple sets, as described above, the set Saved will be the first,
  491. lexically, and its name will be shown in the dialog. Note that when a
  492. set is Saved or altered by any means, the rest of the sets in the
  493. batch are forgotten about.
  494.  
  495. Important: the Save Set button works as before, when clicked upon. It
  496. does a Save As, warning you if you try to save under the same name.
  497.  
  498. Also important: you can do a Save As on a named set by typing
  499. CMD-OPT-S, a familiar enough keystroke. This is a quick way to create
  500. multiple variations on a general theme.
  501.  
  502. After an Open Set or a Save Set (of whatever stripe), the name of the
  503. currently opened set will be reflected in the dialog.
  504.  
  505. In the Pyre of Purification itself, we are showing the space character
  506. as "ú" (ASCII 250, OPT-h) and the OPT-space character as "û" (ASCII
  507. 251, OPT-k). This is done to make them visible, and therefore
  508. _countable_. In consequence, if you actually need to search for either
  509. of these characters (the literal "ú" or "û"), you will need to 'alias'
  510. them as "^ú" and "^û". This seems a small price to pay for characters
  511. you will (I promise) _never_ have occasion to search for.
  512.  
  513. There is more at work in the Pyre. We are exhaustively trapping the
  514. keyboard. Only legal characters are passed (e.g., you can type CTRL-J
  515. all day and nothing will happen), and some are intelligently parsed.
  516. As above, space and OPT-space are converted as you type. If you
  517. should happen to want to type a "ú" or a "û", Torquemada will alias
  518. either for you as you type (these characters will be shown unaliased
  519. if you Paste them from another application; you're responsible for
  520. your own aliasing there).
  521.  
  522. Certain Extended Keyboard keys are handled intelligently. Tab moves you
  523. forward one field, and SHIFT-Tab moves you back one field. Up and Down
  524. move you up and down one line, respectively. Home and Page Up take you
  525. to the top of the current string. End and Page Down take you to the
  526. bottom. The Delete key works (and this may be the lowest-priced
  527. application in which it does!). Help brings up the Torquemada's
  528. Wildcards scorecard, and SHIFT-Help presents the About Torquemada
  529. window.
  530.  
  531. Best keyboard news: SHIFT-Left and SHIFT-Right select (highlight)
  532. text in the way that most (non-nerd-oriented) applications work.
  533.  
  534. Torquemada's icons have changed. If you're a user of past versions of
  535. the software, you may need to force the desktop to recognize that
  536. there's a new Inquistor in town. To do this, first either delete or
  537. archive all old versions of Torque. Then do this:
  538.  
  539. If you are running System Seven:
  540.  
  541. 1. Select the program's icon and do Get Info (CMD-I)
  542.  
  543. 2. Select the icon in the Get Info window
  544.  
  545. 3. Copy, then Paste, then Cut
  546.  
  547. The Copy just loads the Paste buffer. The Paste replaces the
  548. desktop's existing icon record for Torquemada with the contents of
  549. the buffer. The Cut forces the desktop to update its records from
  550. Torquemada's resource fork.
  551.  
  552. If you are running System Six:
  553.  
  554. 1. Rebuild your desktop by restarting your Mac and holding down
  555. CMD-OPT as it boots.
  556.  
  557. 2. You will be advised that "this may take a while", and you will
  558. find that "a while" is a unit of time greater than the lifespan of
  559. some invertebrates.
  560.  
  561. After execution has begn, you can abort a batch of files with
  562. CMD-Period. This will only happen between files, not between sets or
  563. between searches.
  564.  
  565. And: there's some other stuff, but it's either transparent,
  566. intuitively obvious, or an embarrassing correction to a long-standing
  567. problem.
  568.  
  569.  
  570.  
  571. 2. String Literals
  572.  
  573. The simplest use that can be made of Torquemada is to search for
  574. string literals. This means literal text that actually appears in the
  575. source file. For example, you could search for "Elvis" and replace
  576. with "The King". If "Elvis" is present in the file, the replacement
  577. will be made. Torquemada searches are case sensitive, which means
  578. that if "elvis" or "ELVIS" are found in the file, the replacement
  579. will not be made.
  580.  
  581. String literal searching is common; most applications that have a
  582. search and replace function work only on string literals. Used this
  583. way, TQM offers not much more than they, except that you can search
  584. for 20 (or infinity!) string literals at once.
  585.  
  586. But consider: residents of British Commonwealth nations have a tough
  587. way to go when they try to use text written in the United States. A
  588. massive batch of string literals can be just the ticket.
  589.  
  590. And: string literals help to establish uniqueness in search strings
  591. that employ wildthings of various stripes. (I'm not sure I really
  592. have to say this, so I'd better.) Uniqueness means taking pains to be
  593. sure that a search finds only those particular strings you want
  594. changed, and not others. For example, our Queen's English-speaking
  595. friends might want to change color and favor to colour and favour.
  596. They might write the literal search:
  597.  
  598. or              our
  599.  
  600. This is pretty drastically non-unique. It would change the two
  601. desired words, but it would also change the name of this software to
  602. Tourquemada.
  603.  
  604. Uniqueness is one of those things that can only be learned the hard
  605. way. So if the idea is new to you, spend half a day playing with
  606. copies of files.
  607.  
  608.  
  609.  
  610. 3. Aliases
  611.  
  612. ALIASESムMatch special text characters
  613.   ^T or ^t    Tab
  614.   ^P or ^p    Carriage return
  615.   ^^          Caret
  616.   ^ú          ú  ({OPT-h})
  617.   ^û          û  ({OPT-k})
  618.  
  619. You can't type a tab or a return in a dialog box. The Mac toolbox
  620. filters for these characters, regarding them as commands. Tab moves
  621. you from field to field, while hitting return is the same as clicking
  622. the mouse on the Okay button. This is hardly news.
  623.  
  624. If you want to search for one of these characters, you have to use an
  625. 'alias' of it. Torquemada uses Word's convention for denoting these
  626. aliases: tab is known as ^t or ^T, and return is wanted in five
  627. states under the name ^p or ^P. The caret character is used to flag
  628. all of Torque's many wildthings, so it too should be aliased in
  629. search and replace strings: ^^. The caret is ideal for our purposes,
  630. since it almost never appears in text. And, as discussed above, OPT-h
  631. and OPT-k are aliased so that we can use them for better purposes.
  632.  
  633. Take note that you _can_ Paste tabs and returns into a dialog box. If
  634. you do, Torquemada will behave as you expect (since the aliases are
  635. just being turned into the literal tab and return characters at
  636. search time). When you Save Set, a clean-up is run that converts any
  637. Pasted tabs or returns into their aliased form.
  638.  
  639.  
  640.  
  641. 4. Case Conversion
  642.  
  643. CASE CONVERSION COMMANDSムCan be used only on the replace side;
  644.                          accented characters are handled
  645.                          intelligently
  646.   ^C or ^c    CONVERT TO ALL CAPS
  647.   ^L or ^l    convert to all lower case
  648.   ^S or ^s    Convert to sentence caps
  649.   ^U or ^u    Convert To Upstyle Caps
  650.   ^D or ^d    Convert to Downstyle Caps
  651.   ^=          Cancel all case conversion
  652.  
  653. Torquemada includes six case conversion commands that are available
  654. on the replace side only. If your source text is typed ALL CAPS, you
  655. can convert it to sentence caps fairly easily. The commands can be
  656. used only on the replace side because they control the output format
  657. of the text found; they are not themselves something that can be
  658. searched for. If you forget and put one in on the search side, TQM
  659. will cheerfully ignore it with no untoward consequences.
  660.  
  661. But: case conversion by software is far from an exact science. The
  662. commands will get you closer to where you want to be, but you may
  663. have to run additional searches or do manual edits to achieve the
  664. final desired results. This is particularly true of sentence caps and
  665. downstyle caps (first letter of every word capitalized, except for
  666. words of three or fewer letters).
  667.  
  668. However: Torquemada is pretty smart. If your text is totally toasted,
  669. using these commands will save you a _lot_ of time. And the
  670. Inquisitor is a good global citizen: accented characters are
  671. converted appropriately. Moreover, Torque knows when to say when.
  672. Quark's XPress Tags language is case-sensitive ('k' and 'K' mean two
  673. different things). Only one of XP8's commands is case-sensitive. But
  674. in both cases, we're insulating those commands from case conversion.
  675.  
  676. Face it: a file that is typed _all_ in the wrong case is the rare
  677. bird. Further on, we'll see how to use these commands in conjunction
  678. with other wildthings to selectively change case. For example, you
  679. could take just the subheads to ALL CAPS, or change any ALL CAPS
  680. headline to Upstyle Caps. For now, we'll just talk about using these
  681. with string literals. This search:
  682.  
  683. Elvis           ^CElvis^=
  684.  
  685. would result in the word "ELVIS" being written out to the file. In
  686. the replace string, ^C means convert to all caps, and ^= means cease
  687. to convert case. (Of course, a search this simple could be done simply
  688. with literals.) You don't need to use ^= if it is the last thing in
  689. the replace string; Torque will put one there if it doesn't find one.
  690. On the other hand, if you need to terminate case conversion _within_
  691. the replace, then you must explicitly turn it off:
  692.  
  693. Elvis is still the king         ^CElvis^= is still ^Uthe king
  694.  
  695. would result in the text "ELVIS is still The King". We turned
  696. capitalization off after "ELVIS" to avoid changing the case of "is
  697. still". We didn't need to turn upstyle off, since it will be
  698. terminated automatically at the end of the replace string.
  699.  
  700. (For users of earlier versions: Torquemada's case-conversion
  701. routines were made substantially smarter with version 1.2.0.)
  702.  
  703.  
  704.  
  705. 5. Untyped Wildcards
  706.  
  707. UNTYPED WILDCARDSムMatch any one character
  708.   ^0, ^1, ^2, ^3, ^4
  709.  
  710. Okay, this is where the bullet hits the bone. I've been dancing
  711. around this for quite a while, because I wanted to establish good
  712. ground rules before we got to the more hirsute topics. Well, here we
  713. are...
  714.  
  715. Torquemada has 5 untyped wildcards. 'Wildcards' means they are not
  716. literal characters, but rather markers that will match literal
  717. characters. 'Untyped' means they will match _any_ character. In Word,
  718. '?' is a wildcard, but it can only be used on the search side.
  719. Torquemada's wildcards can be used on the search side, and can be
  720. used, omitted or resequenced on the replace side. Torquemada's
  721. untyped wildcards are denoted by the caret character followed by a
  722. number from 0 to 4. Each one of them will match any character and
  723. _store_ the character matched. Taking our earlier example:
  724.  
  725. ^0^1^2or        ^0^1^2our
  726.  
  727. will match and change color and favor. Unfortunately, it still lacks
  728. uniqueness. Because these wildcards are totally untyped, the search
  729. string will also match any instance of the letters "or" and the three
  730. characters before it.
  731.  
  732. Here's a better example. Suppose we have text that looks like this:
  733.  
  734. 1. Blah.
  735. 2. Blah blah.
  736. 3. Blah. Blah blah.
  737.  
  738. If we needed to modify this, say to add a Quark 'Indent Here' command
  739. to make sure that blahish turnovers hang on the indent, we could do:
  740.  
  741. ^p^0.{space}    ^p^0.{space}<¥i>
  742.  
  743. Surely we could do this with literals, but that would get tiresome.
  744. Instead, we can use our knowledge to carefully control ignorance, and
  745. accomplish in one string what might otherwise take three. Note that
  746. we are isolating to uniqueness the text we hit; without the ^p and
  747. the {space}, '^0.' would also match the ends of sentences.
  748.  
  749. Perhaps the best use of untyped wildcards is as ballast for the typed
  750. wildcards (to be discussed next). They do what they do alone quite
  751. well, but it's almost too much ignorance safely to be borne.
  752.  
  753. (Take note: prior to version 1.2.0, Torquemada had 10 untyped
  754. wildcards. If you have old sets that made use of ^5 through
  755. ^9, you will need to revise them.)
  756.  
  757.  
  758.  
  759. 6. Typed Wildcards
  760.  
  761. TYPED WILDCARDSムMatch any one character of that type
  762.   ^+    Uppercase character (includes accented characters)
  763.   ^-    Lowercase character (includes accented characters)
  764.   ^ア    Character of either case (includes accented characters)
  765.   ^&    Alphanumeric character (letter or number, not space or punctuation)
  766.   ^%    Tabular character (digit, space or punct.; not alphabetical)
  767.   ^$    Printable character (all characters _except_ space characters)
  768.   ^「    Any character _EXCEPT_ return
  769.   ^!    Punctuation character (includes high-ASCII punctuation)
  770.   ^.    Sentence Punctuation character (.,;:!?)
  771.   ^#    Numeric character (digits only)
  772.   ^_    Space character (space, return, tab, option space)
  773.   ^ツ    Space character (space, tab, option space, but _NOT_ return)
  774.  
  775. (^「, ^. and ^ツ were added with version 1.2.0.)
  776.  
  777. These are alike unto the untyped wildcards except that they are
  778. strongly typed. A typed wildcard will only match a character of its
  779. type. So, for instance: ^+ will only match uppercase characters, with
  780. all others failing to match. The wildcard ^# will match any digit,
  781. and ^_ will match any space character, so we can go back to blahville
  782. and do a much better job:
  783.  
  784. ^p^#.^_         ^p^#.^_<¥i>
  785.  
  786. This is now fully generalized yet completely unique. If there is a
  787. subtopic such as:
  788.  
  789. a. Subblah.
  790.  
  791. it will fail to match. If we need to do something different with
  792. that, we can match it with another, different string.
  793.  
  794. But: wildcards (typed or untyped) match and store only _one_
  795. character. If you search for:
  796.  
  797. ^#^#
  798.  
  799. only the second digit will be stored. If you need to match and store
  800. two characters of one type, you can use the typed wildcards to
  801. establish uniqueness, then fill out your team with untyped wildcards.
  802. Suppose we needed to match:
  803.  
  804. 10. Double-digit blah.
  805.  
  806. This would work:
  807.  
  808. ^p^#^0.^_       ^p^#^0.^_<¥i>
  809.  
  810. Pretty cryptic, not. This says: where you find a return followed by a
  811. digit followed by any other character followed by a period followed
  812. by a space character, soak it all up and spew it back out, appending
  813. an XPress Tags 'Indent Here' command. We've gone from string literals
  814. that were readable but not very useful to _this_, a vitally important
  815. message from space aliens (grin). And it gets worse. Very shortly,
  816. we'll discuss an even better - and more cryptic - way of handling
  817. this type of problem.
  818.  
  819.  
  820. Not for non-nerds only:
  821.  
  822. Mike Arst quite correctly pinned me to the mat for not going into
  823. these guys in greater detail. Among the wildthings, these present the
  824. greatest potential for confusion. Untyped wildcards (discussed above)
  825. and wildstrings (discussed below) match _anything_. The typed
  826. wildcards only match characters _of their type__ So: this is a
  827. further elucidation of what "of their type" means.
  828.  
  829. Torquemada is written in the C programming language, and the idea of
  830. typed wildcards is borrowed, analogically, from the character typing
  831. functions available in the standard C function libraries. Where
  832. appropriate, these commands use the full Macintosh character set,
  833. where the C functions do not, but the idea is basically the same. A
  834. typed wildcard matches the source character _if and only if_ the
  835. character is of that type; ^+ will match _only_ uppercase letters,
  836. not lowercase letters, not space or punctuation characters, not
  837. digits.
  838.  
  839. Taking them one by one:
  840.  
  841. ^+    Will match and store any one uppercase alphabetical
  842. character. Alphabetical characters include the accented Macintosh
  843. characters (e.g., ç, ). This will _fail_ to match any character that
  844. is not an uppercase character.
  845.  
  846. ^-    Will match and store any one lowercase alphabetical
  847. character. Alphabetical characters include the accented Macintosh
  848. characters (e.g., ‡, Œ). This will _fail_ to match any character that
  849. is not a lowercase character.
  850.  
  851. ^ア    Will match and store any one alphabetical character.
  852. Alphabetical characters include the accented Macintosh characters
  853. (e.g., ç, , ‡, Œ). This will _fail_ to match any character than is
  854. not an alphabetical character. This wildcard is the logical opposite
  855. of the tabular character wildcard (^%). (You type the "ア" by
  856. hitting SHIFT-OPT-=.)
  857.  
  858. ^&    Will match and store any one alphanumeric character.
  859. Alphanumeric characters are alphabetical characters (including
  860. accented characters) and the ten digits. This wildcard will _fail_ to
  861. match any space or punctuation character, which can make it useful
  862. for establishing uniqueness.
  863.  
  864. ^%    Will match and store any one tabular character. A tabular
  865. character is any one of the ten digits, a space character (space,
  866. return, tab, or option space), or a punctuation character (including
  867. Macintosh high-ASCII punctuation such as 。 or à). This wildcard is
  868. intended primarily for matching the elements that make up a table,
  869. exclusive of the explanatory text. Consequently, it will _fail_ to
  870. match any alphabetical character, which can make is useful for
  871. establishing uniqueness. This wildcard is the logical opposite of the
  872. alphabetical character wildcard (^ア).
  873.  
  874. ^$    Will match and store any one printable character. A printable
  875. character is one that makes marks on paper, which means that this
  876. wildcard will match all alphabetical characters, all ten digits, and
  877. all punctuation characters. It will _fail_ to match the space
  878. characters (space, return, tab or option space). This wildcard is the
  879. logical opposite of the space character wildcard (^_).
  880.  
  881. ^「    Will match and store any one character _that is NOT a carriage
  882. return character_. Ergo, it will _fail_ to match return. (You type
  883. the "「" by hitting OPT-4.)
  884.  
  885. ^!    Will match and store any one punctuation character, (including
  886. Macintosh high-ASCII punctuation such as 。 or à). It will _fail_ to
  887. match alphabetical, numeric, or space characters.
  888.  
  889. ^.    Will match and store any one sentence punctuation character.
  890. The sentence punctuation characters are defined as: ".,;:!?" (not
  891. including the dumb quotes). This wildcard was added because the
  892. regular punctuation wildcard (^!) is too general in many
  893. circumstances. This wildcard will match only the six sentence
  894. punctuation characters and it will _fail_ to match all other
  895. characters.
  896.  
  897. ^#    Will match and store any one numeric character (the ten
  898. digits). It will _fail_ to match alphabetical, space, or punctuation
  899. characters.
  900.  
  901. ^_    Will match and store any one space character (space, return, 
  902. tab, or option space). It will _fail_ to match all alphabetical,
  903. numeric, or punctuation characters. This wildcard is the logical
  904. opposite of the printable character wildcard (^$).
  905.  
  906. ^ツ    Will match and store any one space character _that is NOT a
  907. carriage return character_. In consequence, it matches only space,
  908. tab and OPT-space. It will _fail_ to match all other characters.
  909.  
  910.  
  911.  
  912. 7. The Do-It-Yourself Wildcard
  913.  
  914. The Typed Wildcards are pretty through, but sometimes you just have
  915. to Do-It-Yourself. This wildcard lets you. The DIY wildcard matches
  916. the characters _you_ define, and it fails to match any you leave out.
  917. Your definition can include literal characters (abc), ranges of
  918. characters (a-c), or any of the other wildcards (^!abcx-z^#^_). Even
  919. better, you can write the definition in the negative, specifying only
  920. what will _fail_ to match. That is, you could define a DIY wildcard
  921. that would fail to match all digits, all space characters, all
  922. punctuation characters and all low-ASCII alphabetical characters;
  923. this wildcard would match _only_ high-ASCII (accented) alphabetical
  924. characters.
  925.  
  926. Let's ease our way into this, because it's a little complicated. The
  927. form of the DIY wildcard is this:
  928.  
  929. ^ヌ...ネ
  930.  
  931. The leading caret is familiar enough by now. The next character, the
  932. open-guillemot, is typed by hitting the OPT-¥ (backslash) key. The
  933. "..." represents the definition of the DIY wildcard, which we'll come
  934. to shortly. The last character, the close-guillemot, is typed by
  935. hitting SHIFT-OPT-¥. This charcter tells Torque that the definition
  936. is done. The definition of a DIY wildcard _must_ end with a "ネ", with
  937. one exception. If the DIY wildcard is the very last thing in a
  938. string, you can leave it out, in the same way that you can skip "^="
  939. in similar circumstances. Everywhere else, the close-guillemot must
  940. be present. If it isn't, the Inquisitor won't know where to stop the
  941. difinition.
  942.  
  943. But what if you need a close-guillemot _as a part_ of your DIY
  944. wildcard defiinition? Bright sparks will have already guessed the
  945. answer: you alias it as ^ネ. The string
  946.  
  947. ^ヌ^ネネ
  948.  
  949. will match _only_ the close-guillemot character.
  950.  
  951. On the search side, you show the full definition. On the replace
  952. side, you show _only_ the ^ヌ, omitting the definition. Like this:
  953.  
  954. ^ヌabcネ         ^ヌ
  955.  
  956. The ^ヌ is actually _storing_ the character found. The rest of the
  957. difintion is just establishing _what_ will match, which is why it is
  958. omitted on the replace side.
  959.  
  960. The definition of a DIY wildcard can be _retained_ from one string to
  961. the next. If you put nothing between the opening and closing
  962. guillemots, the previously-established definition will be used again.
  963. As before, if it's the last thing in the string, you can leave off
  964. the close-guillemot. So, for example:
  965.  
  966. ^ヌabcネ         ^ヌ          (Matches a, b or c)
  967. ^ヌネ            ^ヌ          (Still matches a, b or c)
  968. ^ヌ             ^ヌ          (Still matches a, b or c)
  969.  
  970.  
  971. Important: the DIY wildcard is just a special case of the ordinary
  972. typed wildcard. It will match and store only _one_ character, the
  973. first one found that fits the definition and the full pattern of the
  974. search string. It behaves just like any other wildcard. If you use
  975. more than one in the search string, only the _last_ one found will be
  976. deployed in the replace. And, as with the other wildcards, it can be
  977. used, omitted or resequenced on the replace side.
  978.  
  979. Okay, here's how to define one. This string:
  980.  
  981. ^ヌABCabcネ
  982.  
  983. will match any one of those literal characters, and no others. You
  984. can include as many literal characters as you want.
  985.  
  986. This string:
  987.  
  988. ^ヌA-Zネ
  989.  
  990. will match the _range_ of characters from A to Z, inclusive. A range
  991. can be established by refrence to an ASCII chart. The range will
  992. include every character from the start of the range to the end. For
  993. example, you could do a less general tabular wildcard with
  994.  
  995. ^ヌ#-9ネ
  996.  
  997. This would match everyting from # (ASCII 35) to 9 (ASCII 57),
  998. inclusive. (This is the definition XP8 uses for tabular characters).
  999.  
  1000. Take note: in most GREPs, a range must be an _ascending_ range. This
  1001. is not true in Torquemada. You could just as easily say ^ヌZ-Aネ or
  1002. ^ヌ9-#ネ.
  1003.  
  1004. You can have more than one range in a definition, or ranges plus
  1005. literals, like this:
  1006.  
  1007. ^ヌA-Zz-a01234567890ネ
  1008.  
  1009. or this:
  1010.  
  1011. ^ヌ01234567890A-Zz-aネ
  1012.  
  1013. or this:
  1014.  
  1015. ^ヌA-Z01234567890z-aネ
  1016.  
  1017. Each of these would match _only_ digits or low-ASCII alphabetical
  1018. characters, with all others failing to match.
  1019.  
  1020. And: you can include other wildcards _within_ your definition. This
  1021. string:
  1022.  
  1023. ^ヌ^#A-Zz-aネ
  1024.  
  1025. does the same job as the three listed above. Since the DIY wildcard
  1026. is establishing the _type_ of characters it will match in its
  1027. definition, it makes sense to inlcude the other typed wildcards
  1028. within the definition. This:
  1029.  
  1030. ^ヌA-Zz-a^#^!^_ネ
  1031.  
  1032. will match everything _except_ high-ASCII (accented) alphabetical
  1033. characters. Heck of a lot faster than typing all of those
  1034. hand-breakers.
  1035.  
  1036. Important: you can put either untyped wildcards or wildstring tokens
  1037. (discussed below) into your definition. If you do, the DIY wildcard
  1038. will match _anything_, since this is the range of characters defined
  1039. by those wildthings. I don't think this is such a swell idea, but I
  1040. made it possible just because you might need one extra untyped
  1041. wildcard someday. In any case, no matter what else is defined, a
  1042. (non-negative) DIY wildcard that includes either an untyped wildcard
  1043. or a wildstring token will match anything.
  1044.  
  1045. At the end of this section, we'll discuss some uses of typed
  1046. wildcards with the DIY wildcard.
  1047.  
  1048. Here's the coolest part: you can write a _negative_ definition. In
  1049. other words, you can define only what will _fail_ to match, with all
  1050. other characters matching. This string:
  1051.  
  1052. ^ヌ!A-Zz-a^#^!^_ネ
  1053.  
  1054. will match _only_ high-ASCII (accented) alphabetical characters. The
  1055. leading exclamation point establishes the definition as negative. The
  1056. remainder of the string specifies the characters that will _fail_ to
  1057. match the DIY wildcard. Since the only characters that are not
  1058. spaces, punctuation, digits or low-ASCII letters are accented
  1059. characters, these are the _only_ characters that will be matched.
  1060.  
  1061. As above, untyped wildcards and wildstring tokens can be included in
  1062. a negative definition, but the results are guaranteed to be
  1063. non-optimal. This
  1064.  
  1065. ^ヌ!^4ネ
  1066.  
  1067. says "match and store nothing". The "!" says "don't match" and the
  1068. "^4" says "every possible character". Search strings that include any
  1069. variation on this construct are entirely dysfunctional and will
  1070. result in no replacements. No extra charge...
  1071.  
  1072. The negative definition is a notational convenience. It does nothing
  1073. that cannot be done with a positive (normal) definition. It's just
  1074. faster, and, very often, easier on the hands and head. For example,
  1075. if you need a second ^「, you can get it very easily with:
  1076.  
  1077. ^ヌ!^pネ
  1078.  
  1079. But wait! What if we need a "!" as part of our definition? And what
  1080. about the "-" character? The exclamation point and hyphen establish
  1081. their meaning from their _position_ within the definition. The
  1082. definition is negative _if and ONLY if_ the exclamation point is the
  1083. first character in the definition. Otherwise, it's interpreted as a
  1084. literal text character. So if you need it in your definition, put it
  1085. anywhere but in the first position.
  1086.  
  1087. The hyphen is but slightly trickier. To include a hyphen in your
  1088. definition, put it in the first position, or in the second if the
  1089. first is occupied by an exclamation point. All other hyphens are
  1090. interpreted as defining ranges.
  1091.  
  1092. Here are some cool ways the DIY wildcard can be used along with other
  1093. wildcards.
  1094.  
  1095. If you have a font that uses the high-ASCII slots for purposes other
  1096. than those decreed by Adobe, you can use the DIY wildcard to insulate
  1097. those slots from case conversion:
  1098.  
  1099. ^ヌA-zネ          ^U^ヌ^=
  1100.  
  1101. This would convert _only_ low-ASCII alphabetical characters to
  1102. Upstyle initial caps. There are some punctuation characters in that
  1103. range, but they don't matter since case conversion ignores them.
  1104. (And, yes,  both "ネ" and "^=" are redundant in this context, but Good
  1105. Practice decrees that we put them in. If, later, I add somehting to
  1106. the end of either string, I don't have to remember to add them, or
  1107. suffer the consequences of having forgotten to remember. In other
  1108. words, their omission is tolerated (and coded for) but Not
  1109. Recommended.)
  1110.  
  1111. You could use a very simple sort of definition to more firmly
  1112. establish uniqueness. For example,
  1113.  
  1114. ^#^ヌ^#ネ
  1115.  
  1116. will match _only_ two consecutive numbers. Something like ^#^& or ^#%
  1117. might let some wierdness through.
  1118.  
  1119. Obviously, you can use wildcards singly, as above, to create a
  1120. temporary twin. And you can use them in combination (along with
  1121. literals and ranges) to establish your own special types. And, of
  1122. course, the _antithesis_ of any typed wildcard can be had simply by
  1123. negating it. This
  1124.  
  1125. ^ヌ!^+ネ
  1126.  
  1127. will match anything that is _not_ an uppercase letter.
  1128.  
  1129. This is not the easiest stuff in the world, but it repays mastery. In
  1130. the section after next, you'll find out why we spent so much time
  1131. talking about it.
  1132.   
  1133.  
  1134.  
  1135. 8. Wildstrings
  1136.  
  1137. WILDSTRINGSムMatch and store any text until full pattern is matched
  1138.   ^*, ^~, ^?, ^@
  1139.  
  1140. Now this is the really cool stuff. There are four wildstrings and
  1141. each will match and store any text until the pattern defined in the
  1142. search string is satisfied. As an example, consider a full case
  1143. conversion. You got a file typed in ALL CAPS, and you need it to be
  1144. Sentence caps. This will do the job:
  1145.  
  1146. ^~        ^S^~
  1147.  
  1148. The search string says: "match anything, from the start of the buffer
  1149. to the end." The replace string says, "spew it all back out with the
  1150. case converted".
  1151.  
  1152. A more complicated example: the client was thoughtful enough to
  1153. provide the keystrokes on disk, but the heads and subheads are all
  1154. typed ALL CAPS (there are many such thoughtful clients). To convert
  1155. them all to Upstyle (presuming that the heads to be hit are preceded
  1156. by double-returns), you could do:
  1157.  
  1158. ^p^p^*^p        ^p^p^U^*^p^=
  1159.  
  1160. Wildstrings are massively general. Except for gross transformations,
  1161. you really have to build a lot of uniqueness into the pattern, or
  1162. they will bleed all over you. But try this on for size: I wish I
  1163. could count the number of times I've gotten files that were typed
  1164. like this:
  1165.  
  1166. First        Fifth
  1167. Second       Sixth
  1168. Third        Seventh
  1169. Fourth       Eighth
  1170.  
  1171. In every publishing system known to humanity, this should be typed as
  1172. one long column, with fifth following fourth. The helpful clients
  1173. type it in two columns with tabs so that you'll know it should be one
  1174. link spanning a gutter. Do it the cheap way, with tabs, and surely
  1175. you'll have to insert a line between second and third. Have fun
  1176. cutting and pasting... Or: run a set like this:
  1177.  
  1178. ^t^*^p        ^p
  1179.  
  1180. This will throw away everything in the right column, preserving
  1181. everything in the left. Then run:
  1182.  
  1183. ^p^*^t        ^p
  1184.  
  1185. This will throw away everything in the left column, preserving the
  1186. right.
  1187.  
  1188. Then concatenate the two files and you've got the text the way you
  1189. need it, in one long column.
  1190.  
  1191. How these work: wildstrings will match and store any characters found
  1192. in the source until the full pattern is matched. If the pattern is
  1193. matched immediately after the call to the wildstring, it will store
  1194. zero characters. This is useful. It means you can say:
  1195.  
  1196. ^p^~^$        ^p^$
  1197.  
  1198. This will find all runs of one or more returns (or returns with other
  1199. space characters) and compact them down to exactly one return. If the
  1200. file has only single returns in it, the wildstring will contain zero
  1201. characters each time it is employed.
  1202.  
  1203. If the pattern fails to match, the text is passed through unaltered.
  1204.  
  1205. A wildstring can contain the whole buffer of text, as shown above.
  1206. Searching for a pattern match will continue to the end of the buffer.
  1207. In consequence, insufficient uniqueness can result in failures to
  1208. find a match along with very slow performance. So: be sure to deploy
  1209. these puppies in full cognizance of the actual contents of the file.
  1210.  
  1211. Wildstrings are completely untyped, but they can be fairly strongly
  1212. 'typed' by the characters used before and after them. Needless to say,
  1213. string literals provide the strongest typing, but the more strident
  1214. typed wildcards also do very well. The string above that illustrates
  1215. how to compact runs of returns is a good example: we are saying
  1216. "match everything from a return to a printable character". Printable
  1217. characters are characters that are _not_ spaces, so the wildstring is
  1218. 'typed' to contain _only_ space characters. A string like this:
  1219.  
  1220. ^t^%^~^p        ^t<f"E Century">^%^~<f$>^p
  1221.  
  1222. will find the tabular columns of a table (viz., not the text stubs at
  1223. the left margin) and plug in XPress Tags coding to change the font.
  1224.  
  1225. A search string can contain more than one wildstring, up to the full
  1226. complement of four. At the same time, wildstrings can be resequenced
  1227. on the replace side. So, if that Officers and Directors chart comes
  1228. with the jobs before the names, you can swap them.
  1229.  
  1230. One more (this happened to me recently, and it's happened many times
  1231. in the past): pick up last year's financials, lose the right-most
  1232. column, kick everything right, and plug in a new column for this
  1233. year's figures. Bah! Mondo-beyondo manual labor, even with QuicKeys.
  1234. Here's a quick set that does the job on my kind of three-column
  1235. table:
  1236.  
  1237. <t41>^t<t-3>^t^*^t^~^t^?^p        <t41>^t<t-3>^tXX^t^*^t^~^p
  1238.  
  1239. The "XX" is there to hold the tab, to give the operator something to
  1240. double-click on. Yes, the operator had to type the figures;
  1241. intelligent hashing is for next week (grin). But: moving the columns
  1242. took minutes instead of hours, and the proofreader only had to read
  1243. the new copy, not the whole job.
  1244.  
  1245. Note: if you want, you can include the same one wildstring more than
  1246. once on the replace side. The set "Use last name twice" illustrates
  1247. the principle. If you run it on the file named "Use last name
  1248. twice.test", then compare the two files, you'll see how useful this
  1249. can be.
  1250.  
  1251. On the point: it has always been possible to repeat wildcards on the
  1252. replace side - just not terribly useful. Using wildstrings this way
  1253. won't come up every day, either, but it's a nice thing to have when
  1254. you need it.
  1255.  
  1256. There is a _ton_ of power in these babies, so do take the time to
  1257. master them, The effort will be repaid a hundred-fold.
  1258.  
  1259.  
  1260.  
  1261. 9. The Wildstring Modifier
  1262.  
  1263. You may not know it yet, but _this_ is why you paid cash money for this
  1264. software. Every wildthing that was added with version 1.2.0 - ^「, ^.,
  1265. ^ツ, and the DIY wildcard - was added in the service of this token. I
  1266. call it a token, because it's not really a wildcard. It doesn't
  1267. _match_ anything. What it does is constrain the type of characters
  1268. that a wildstring can match.
  1269.  
  1270. The wildstring modifier looks like this: "^<". You use it in strings
  1271. like this:
  1272.  
  1273. ^#^<^~
  1274.  
  1275. That says: match and store one digit, then continue match digits
  1276. until the first non-numeric character, then _stop_ matching. In other
  1277. words, the wildstring will contain _nothing_ but (zero or more)
  1278. digits, nothing else. Its wildness has been _contstrained_, reined in
  1279. by by the wildstring modifier. An unmodified wildstring will match
  1280. and match and match, ceaselessly. But when it is preceded by the
  1281. wildstring modifier, it will _only_ match the type of the character
  1282. that immediately precedes the wildstring modifier.
  1283.  
  1284. In use, it looks like this:
  1285.  
  1286. ^#^<^~          ^#^~
  1287.  
  1288. The wildstring modifier is omitted on the replace side, since its
  1289. only purpose is to constrain the wildstring during the search. If you
  1290. forget and put it on the replace side, guess what happens? Yes, of
  1291. course, Torquemada cheerfully ignores it.
  1292.  
  1293. The wildstring modifier is position dependent. It must be preceded by
  1294. a character or a wildcard (not a wildstring), and it must be followed
  1295. by a wildstring (not a character or a wildcard). If the sequence of
  1296. characters in the search string fails to satisfy that form, the
  1297. wildstring modifier itself is ignored (the rest of the search string
  1298. is honored).
  1299.  
  1300. If the wildstring modifier is preceded by a wildcard, the wildstring
  1301. is constrained to the type of that wildcard. For example, you could
  1302. clean up a badly-formatted table like this:
  1303.  
  1304. ^%^<^?          |^%^?          (Mark all table columns)
  1305. ^_^<^?|         ^t             (Compact all space runs before
  1306.                                table columns to one tab)
  1307.  
  1308. And yes, the wildstring modifier can be legally preceded by an
  1309. untyped wildcard, but this would be an entirely redundant
  1310. construction.
  1311.  
  1312. If the wildstring modifier is preceded by a literal character, the
  1313. wildstring is constrained to _that character EXACTLY_. Earlier we
  1314. talked about using wildstrings to compact runs of returns (keep in
  1315. mind that "^p" is an alias for a literal character). Here's a far
  1316. better way:
  1317.  
  1318. ^p^<^?          ^p
  1319.  
  1320. Here's a similar example: the client made a fill-in-the-blanks form
  1321. using scads of underbars. You could do this:
  1322.  
  1323. _^<^?           ^t          (Convert underbar runs to a tab)
  1324.  
  1325. Of course, if you want to retain a certain minimum number of
  1326. underbars, just use one more than that number in your search string.
  1327. This will preserve three or fewer:
  1328.  
  1329. ____^<^?        ^t
  1330.  
  1331. _Only_ the character or wildcard immediately preceding the wildstring
  1332. modifier is used to constrain the wildstring. Suppose you need to
  1333. "cast" the wildstring to more than one type...?
  1334.  
  1335. If you said "DIY wildcard", score one for you. Of course, the _whole_
  1336. pattern must match before the replace will take place, as with the
  1337. four underbars above. But you can keep it short and sweet with the
  1338. DIY wildcard. The table example above can let some stuff through that
  1339. you might not want, resulting in superfluous tabs. This is more
  1340. unique, hence safer:
  1341.  
  1342. ^ヌ#-9ネ^<^?          |^ヌ^?          (Mark all table columns)
  1343. ^ツ^<^?|             ^t             (Compact all space runs before
  1344.                                    table columns to one tab)
  1345.  
  1346. The first search defines "tabular character" more rigorously
  1347. (^ヌ$%(),.-^#ネ is more rigorous still), resulting in fewer false
  1348. positives. The second line matches _only_ space characters _that are
  1349. in the same paragraph_ as the mark we left behind. This is _why_ both
  1350. "^ツ" and "^「" exist. One of Torquemada's best features is his ability
  1351. to read around returns, but sometimes it's too much of a good thing;
  1352. you can wait a long time to achieve results far removed from your
  1353. expectations. Torquemada does _exactly_ what you tell him to do.
  1354. Those two typed wildcards, in conjunction with the wildstring
  1355. modifier, let you order the Inquisitor around in more strident terms.
  1356. So, what's the benefit? In the second line above, the string is
  1357. forbidden to toast the return in source copy that looks like this:
  1358.  
  1359. Stub     $123
  1360. Stub     $456
  1361.          $789
  1362.  
  1363. That stubless third line would get hosed by our first example, but
  1364. not the second.
  1365.  
  1366. The trick is to manage your knowledge in such a way that you can use
  1367. it to leverage ignorance into certainty. In a badly formatted table,
  1368. there will be _plenty_ of extra spaces, but only _some_ of them
  1369. should be compacted to tabs. The rest should become single spaces.
  1370. We're using our knowledge to isolate cases of the first type, then
  1371. operating intelligently on _only_ those. The marking trick we're
  1372. doing in the table will be discussed more in the next section.
  1373.  
  1374. This has come up: the text looks something like this:
  1375.  
  1376. 1 This line contains K1.
  1377. 2 This line contains K1 and K2.
  1378. 3 This line contains K2.
  1379. 4 This line contains K2 and K1.
  1380. 5 This line contains K1.
  1381. 6 This line contains K1 and K2.
  1382. 7 This line contains K2.
  1383. 8 This line contains K2 and K1.
  1384.  
  1385. where "K1" and "K2" are known instances of literal text. We want to
  1386. operate _only_ on lines that contain both K1 and K2, in that order.
  1387. This example is obviously trivialized; in real life we can't count on
  1388. the consistency of the surrounding text. A straight wildstring search
  1389.  
  1390. K1^?K2        <B>K1^?K2<B>
  1391.  
  1392. would result in garbage. It would also take a while on a big file,
  1393. since any failures will have to fail to the end of the buffer. No
  1394. fault: Torquemada is doing what we told him to do. By contrast,
  1395.  
  1396. K1^「^<^?K2        <B>K1^「^?K2<B>
  1397.  
  1398. will do exactly what we want, and very quickly to boot. Because the
  1399. wildstring can only match characters that are _not_ the carriage
  1400. return character, the search pattern will _fail_ to match as soon as
  1401. that character is encountered. Only lines 2 and 6 match the pattern,
  1402. so the replace string will be deployed only on those two.
  1403.  
  1404. And: you can use DIY wildcard definitions to create additional
  1405. same-paragraph wildstring modifiers. For example
  1406.  
  1407. ^ヌ!^!^pネ^<^?
  1408.  
  1409. will match only non-punctuation characters that are all in the same
  1410. paragraph.
  1411.  
  1412. Because "^<" stores nothing, there is no restriction on the number of
  1413. times it can be used on the search side. Obviously, you should not use
  1414. it any more than four times (one for each wildstring) if you are
  1415. retaining the copy from all wildstrings. But if you are tossing copy
  1416. for one or more wildstrings, you can use it as many times as you need it.
  1417.  
  1418. For example:
  1419.  
  1420. If you have copy like this:
  1421.  
  1422. Good    junk    junk    junk    junk    junk    Good    Good
  1423.  
  1424. this string:
  1425.  
  1426. ^?^t^$^<^*^t^$^<^*^t^$^<^*^t^$^<^*^t^$^<^*^t^~^p     ^?^t^~^p
  1427.  
  1428. will pack and repack all of the junk into the same one wildstring,
  1429. which is being thrown away in any case.
  1430.  
  1431. Included on this disk is a commented set called "Extract Text from
  1432. PostScript". This is still under construction. There is much about it
  1433. that is not ideal, just yet. It permits too much garbage to pass
  1434. through, and it takes a _long_ time to run (since it's main job is
  1435. matching and throwing away everything that _isn't_ text). But it gets
  1436. better every time I play with it, and it illustrates some of these
  1437. concepts very well. And - who knows? Someday you may need desperately
  1438. to recover the keystrokes from a PostScript file. With the wildstring
  1439. modifier, you can do it...
  1440.  
  1441.  
  1442.  
  1443. 10. Torquemada's Ghost
  1444.  
  1445. Torquemada's Ghost is simply an AppleEvent-aware version of the
  1446. Torquemada S&R engine. While it can be used interactively by Drag &
  1447. Drop, its primary purpose is to allow AppleEvent scripters to access
  1448. Torquemada from their AppleScript or Frontier scripts. Frontier
  1449. scripter Eugene Barnes has lent us his expertise by writing Frontier
  1450. glue scripts for Torquemada's Ghost. These scripts and their
  1451. documentation can be found in the folder "Torquemadaユs Ghost Glue ト".
  1452.  
  1453. In essence (I am not a scripter), you would access Torquemada's Ghost
  1454. from a script like this: send a host of set files and text files to be
  1455. processed to the Ghost. As the last file in the batch, send a 'control
  1456. file', a text file with the creator TQM+. The file "GhostBuster"
  1457. explains how to build a control file (it ain't hard).
  1458.  
  1459. The control file exists to tell the Ghost what to do with the files
  1460. it processes. It can contain a 'path' to a destination folder. If it
  1461. does, then the newly created '.TQM' files will be created in that
  1462. destination folder, rather than in the same folders as the source
  1463. files.
  1464.  
  1465. When we finish a batch started by a control file, we make
  1466. an empty file called "Batch completed..." in the home folder of the
  1467. control file. That way, your script can keep trying to delete that
  1468. file until it succeeds. While it is failing, the batch is not
  1469. complete. As soon as it succeeds, the batch is done. In C, the loop
  1470. would look like this:
  1471.  
  1472.     while (FSDelete ("¥pBatch completed...", controlFile.vRefNum))
  1473.         ;
  1474.  
  1475. FSDelete is going to return a (non-zero) error message when it fails,
  1476. so we just do this until we get a zero back, indicating success. (Note
  1477. that I wrote this in C because that's what I know. Pursue Eugene's
  1478. examples to find out how to do it in Frontier.)
  1479.  
  1480. It is also possible to use Torquemada's Ghost interactively, by Drag &
  1481. Drop. Just drop your sets and files on the icon, much as you would
  1482. with Torquemada the Inquisitor. When you hit "Start", the files will
  1483. be processed as you would expect - taking account of the important
  1484. differences noted below.
  1485.  
  1486. Interactively, it is also possible to 'target' files to a specified
  1487. destination folder. If you hold down the Command key as you hit
  1488. "Start...", you will be prompted for a destination folder for your
  1489. newly-created files.
  1490.  
  1491. Whether by script or double-click, if Torquemada's Ghost is launched
  1492. without receiving any files, it will stay resident until it is
  1493. explicitly quit. If it is launched _with_ files, it will quit at the
  1494. end of the batch. As with Torquemada the Inquisitor, you can abort a
  1495. batch of files with CMD-Period. This will only happen between files,
  1496. not between sets or between searches.
  1497.  
  1498. IMPORTANT DIFFERENCES: First, while Torquemada the Inquisitor
  1499. processes set files in alphabetical order, Torquemada's Ghost
  1500. processes S&R set files IN THE ORDER RECEIVED. The reason is this: set
  1501. files in Torquemada's Ghost can originate from many different folders.
  1502. Presumably, some are boilerplate sets used to solve common problems.
  1503. Imposing an alphabetization restriction on them would surely drive
  1504. everyone crazy.
  1505.  
  1506. Second, text files, too, can originate from different folders. You can
  1507. Drag & Drop from all over, and everything will go back where it came
  1508. from - or, alternatively, where you specify - when you hit "Start".
  1509.  
  1510. Third, Torquemada's Ghost can run in the background. If you have a
  1511. huge job to do, you can set it up and start it running, then go do
  1512. other work. Torquemada's Ghost uses a lot of cycles, so backgrounding
  1513. is not as terrifically useful as it might at first sound, but it _is_
  1514. possible. Note that even in the foreground, Torquemada's Ghost will be
  1515. somewhat slower than Torquemada's the Inquisitor.
  1516.  
  1517.  
  1518.  
  1519. 11. Putting It All Together
  1520.  
  1521. There is a boatload of Torquemada sets travelling with this document,
  1522. to illustrate various points discussed. None of the sets here is very
  1523. elaborate, but my feeling is (despite what you may surmise from
  1524. reading the DTPForum on CompuServe) the elaborate set is the
  1525. exception, rather than the rule. Most search and replace jobs are
  1526. fairly simple if they can be generalized to their essence.
  1527.  
  1528. As an admonition: if this stuff is largely new to you, you are well
  1529. advised to take your Torque in small doses. Build the vicious set
  1530. that does the worst of the reformatting, then have a look at the
  1531. output file. Write a new set to do the finer sifting, then have
  1532. another look. There is no shame in having a file named
  1533. "file.TQM.TQM.TQM.TQM". The shameful thing would be toasting your
  1534. text by trying to do too much at once. My own files tend to be named
  1535. "kill.XP8.TQM.XP8.TQM", since I use XP8 to do the gross clean up,
  1536. Torque to code for XP8, XP8 to unpack the Torque coding (e.g., I'd
  1537. much rather replace with "[n77]" than "<f"Univ NewswCommPi">M<f$>"),
  1538. then Torque, finally, to finesse. What works best is what works
  1539. fastest, not the set that wins the Nobel Prize for Cryptic
  1540. Communication With Space Aliens (this from the man who came up with
  1541. all these cryptic commands!).
  1542.  
  1543. Here's a brief discussion of the sets enclosed and what they do:
  1544.  
  1545. 'PC to Mac PostScript' uses literals and one wildstring to clean up
  1546. PostScript files that originate on DOS machines but are being
  1547. downloaded from Macs. Torquemada automatically removes the linefeeds
  1548. (which are not a problem in any case). This set removes other
  1549. characters, common in PC-PostScript files, which _can_ be a problem
  1550. (most notably the control-D character which starts and ends many
  1551. PC-PostScript files).
  1552.  
  1553. 'Stupefaction' uses nothing but string literals and aliases to recode
  1554. Mac-like text into a form that can be used on computers less swift.
  1555. Ideally, you should reformat the output in an editor (e.g., Save As
  1556. Text Only With Linebreaks from Word). That way, those DOS pigs might
  1557. actually be able to open the file.
  1558.  
  1559. 'Reformat DOS File (Commented)' does the opposite. It takes files
  1560. that originated on DOS systems and reformats them to a fairly
  1561. Mac-like form. This set is interesting on several grounds. First, it
  1562. illustrates how to comment a TQM set: if the search string is empty,
  1563. the replace string is ignored. Consequently, you can embed
  1564. explanatory comments in your sets simply by typing them into the
  1565. replace side. Since you can run up to 32 sets in a batch, this can be
  1566. a swell idea: logically separate the types of searches you're
  1567. running, then comment each set for future reference. This file is
  1568. also making moderately interesting use of wildstrings. And finally,
  1569. the set is using markers to permit intelligent processing of special
  1570. cases.
  1571.  
  1572. This warrants its own paragraph: recall that a later search can look
  1573. for things left behind by an earlier replace. It is entirely possible
  1574. to have a problem complicated enough that you cannot fully resolve
  1575. all doubts in one search. In a case like that, you can leave markers
  1576. behind (viz., "|" or "][", anything that is unlikely to show up in
  1577. the text), then operate on them with later searches. In extreme
  1578. cases, you might need to drop in two or more markers, then operate
  1579. intelligently on the quantity present when you get around to ditching
  1580. them.
  1581.  
  1582. Or, suppose you get a file in Atari or Commodore ASCII. This seems
  1583. unlikely at this late date, but stranger things have happened. The
  1584. ASCII in those two systems was swapped: uppercase lived where
  1585. lowercase belonged, and vice versa. Presumably this was done for a
  1586. reason (to make sorting difficult?), but, whyever, it's a big problem
  1587. for you. This set will toggle the case of any file:
  1588.  
  1589. ^+        |^+
  1590.           Mark existing caps
  1591. ^-        ^C^-
  1592.           Existing lower case to ALL CAPS
  1593. |^+       ^l^+
  1594.           Marked caps to lower case
  1595.  
  1596. 'Sentence Caps' shows the first thrust at a very thorny problem.
  1597. Suppose you have a file that was typed ALL CAPS. Not all that common,
  1598. but it happens. Getting to Sentence caps is fairly easy, but in
  1599. getting there, you will have lost most of the caps on proper nouns.
  1600. Get set to run a load of literals, because that's the only way to
  1601. catch most of them. But at least one can be captured with a
  1602. generalized search, as shown in the second search in this set. This
  1603. will convert names in the form of Firstname I. Lastname back to
  1604. initial caps.
  1605.  
  1606. 'XP8 to PageMakerィ' takes text processed by XP8 or Saved As XPress
  1607. Tags from Quark and puts it into a form that can be used by the Smart
  1608. ASCII filter in PageMaker. Aldus has promised a smarter Smart ASCII
  1609. filter. If you use PM, you might entreat them to hurry, because there
  1610. is a lot of cool stuff that can be done with Torquemada if there is
  1611. proper support from the destination application.
  1612.  
  1613. 'Preserve Left Column' and 'Preserve Right Column' are discussed
  1614. above.
  1615.  
  1616. 'Code Alternating Paragraphs' uses wildstrings to code any file that
  1617. comes in the form of:
  1618.  
  1619. A
  1620. B
  1621. A
  1622. B
  1623.  
  1624. Examples of this type of file: Q&A files, Officers and Directors
  1625. tables, phone or store listings, etc. The codes shown are XPress
  1626. Tags, but this would work just as well with PageMaker Smart ASCII
  1627. tags.
  1628.  
  1629. 'Code Well-Ordered File' uses wildstrings to code files that come in
  1630. the form of:
  1631.  
  1632. Head
  1633. Sub
  1634. Body
  1635. Sub
  1636. Body
  1637. Head
  1638. Body
  1639. Head
  1640. Sub
  1641. Body
  1642.  
  1643. The presumption is that headlines and subheads are preceded by
  1644. multiple returns, which is usually the case with this type of file.
  1645. Note that we are using two different body styles, since frequently
  1646. you want to omit the paragraph indent for the first paragraph after a
  1647. head.
  1648.  
  1649. And you can see the point: the judicious use of Torquemada can remove
  1650. much of the labor - and certainly the most onerous labor - from a text
  1651. processing job. In my own work, I am striving to do everything with
  1652. software, with no manual labor at all...
  1653.  
  1654.  
  1655.  
  1656. 12. Bringing It All Back Home
  1657.  
  1658. This is way awesome cool, if I do say so myself (grin).
  1659.  
  1660. My little ugly duckling has become a text-processing powerhouse.
  1661. Infinite searches on 256 files with 29 wildthings yields a
  1662. solution to all but the most intractable text-processing problems...
  1663.  
  1664.  
  1665.  
  1666. Very Best!,
  1667.  
  1668. Greg Swann
  1669. 8/1/98
  1670.  
  1671.  
  1672.  
  1673. APPENDIX A - TORQUEMADA QUICK REFERENCE
  1674.  
  1675.  
  1676. ALIASESムMatch special text characters
  1677.   ^T or ^t    Tab
  1678.   ^P or ^p    Carriage return
  1679.   ^^          Caret
  1680.   ^ú          ú  ({OPT-h})
  1681.   ^û          û  ({OPT-k})
  1682.  
  1683. UNTYPED WILDCARDSムMatch any one character
  1684.   ^0, ^1, ^2, ^3, ^4
  1685.  
  1686. TYPED WILDCARDSムMatch any one character of that type
  1687.   ^+    Uppercase character (includes accented characters)
  1688.   ^-    Lowercase character (includes accented characters)
  1689.   ^ア    Character of either case (includes accented characters)
  1690.   ^&    Alphanumeric character (letter or number, not space or punctuation)
  1691.   ^%    Tabular character (digit, space or punct.; not alphabetical)
  1692.   ^$    Printable character (all characters _except_ space characters)
  1693.   ^「    Any character _EXCEPT_ return
  1694.   ^!    Punctuation character (includes high-ASCII punctuation)
  1695.   ^.    Sentence Punctuation character (.,;:!?)
  1696.   ^#    Numeric character (digits only)
  1697.   ^_    Space character (space, return, tab, option space)
  1698.   ^ツ    Space character (space, tab, option space, but _NOT_ return)
  1699.  
  1700. DO-IT-YOURSELF WILDCARD-Match any one character of the type you define
  1701.   ^ヌ...ネ    "..." is your definition
  1702.  
  1703. WILDSTRINGSムMatch and store any text until full pattern is matched
  1704.   ^*, ^~, ^?, ^@
  1705.  
  1706. THE WILDSTRING MODIFIER-Constrain following wildstring to type of
  1707.                         preceding wildcard or character
  1708.   ^<
  1709.  
  1710. CASE CONVERSION COMMANDSムCan be used only on the replace side;
  1711.                          accented characters are handled
  1712.                          intelligently
  1713.   ^C or ^c    CONVERT TO ALL CAPS
  1714.   ^L or ^l    convert to all lower case
  1715.   ^S or ^s    Convert to sentence caps
  1716.   ^U or ^u    Convert To Upstyle Caps
  1717.   ^D or ^d    Convert to Downstyle Caps
  1718.   ^=          Cancel all case conversion
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724. APPENDIX B - A SERMON ON TOLERATION
  1725.  
  1726.  
  1727. As I say elsewhere in this manual, Torquemada The Inquisitor owes his
  1728. name to a joke originally played by an exceptionally crafty crafter
  1729. of crossword puzzles. But, upon reflection, I've decide that I can't
  1730. make a joke of that kind without a word or two of explanation.
  1731.  
  1732. For the year 1992 marked not only the 500th anniversary of the
  1733. discovery by Columbus of the West Indies, but also the 500th
  1734. anniversary of the expulsion of the Jews from Spain by the original
  1735. Torquemada, Frey Tom‡s de Torquemada, Dominican friar, Inquisitor
  1736. General of The Holy Office of Spain - more popularly known as The
  1737. Spanish Inquisition.
  1738.  
  1739. The former event is being met with studied indifference punctuated by
  1740. occasional breast-beating by people who can never hope to match
  1741. Columbus in stature, either in virtue or vice. The latter event is
  1742. all but forgotten, to our peril.
  1743.  
  1744. Pity the post-modern West! What spiteful, envious, small-minded
  1745. gossips we have become. We absolve ourselves of sloth and complacency
  1746. by trying to sully every manifestation of the truly heroic we can
  1747. find. We can safely excuse ourselves of striving to the virtues of
  1748. Columbus by focusing on his vices. We can forgive ourselves for
  1749. lacking Ferdinand's courage - the courage that drove the Moorish
  1750. empire from Granada - by nattering about his bastards. We can muddle
  1751. along in the fog of the safely irresolute, with our only firm
  1752. conviction being that the conviction of Isabella - who stared down
  1753. the armed chivalry of the Spains - is "impractical". After all, she
  1754. had to pawn her jewels to fund that fool's errand of the Genoese...
  1755.  
  1756. We are a "practical" people, and we set no value above our safety,
  1757. our comfort, and our leisure. Heroes are demanding, so we have idols
  1758. instead. We demote heroes at the first sight of a flaw, thus sparing
  1759. ourselves the demands of the heroic. For our idols, anything goes,
  1760. but of our heroes we will tolerate no imperfection. The West allows
  1761. but one symbol of heroism to stand, albeit on one leg. And, of
  1762. course, he allowed his feet to be washed by a whore, a juicy tidbit
  1763. we do well to keep from Torquemada's spiritual heirs...
  1764.  
  1765. Thankfully, we are "practical" enough to have "practical" political
  1766. parties, the Gutless Socialists and the Gutless Facists, going by
  1767. different names in different nations. Thankfully, because by virtue
  1768. of their lack of both courage and conviction, they are not apt to do
  1769. anything too terribly ambitious, such as build crematoria. We have
  1770. made ourselves "practically" safe, all without having to stray too
  1771. far from the sofa and the remote control...
  1772.  
  1773. Why, we're "practically" as safe as were the Israelites in the
  1774. newly-formed nation of Spain!
  1775.  
  1776. "Reasoning by specious analogy!", we can protest, conveniently
  1777. ignoring the blood of 150 million political murders that has already
  1778. stained this century. "Demagoguery!", we can shout, neglecting the
  1779. re-enslavement of the entire globe on terms far more rapacious than
  1780. those demanded by the Romans or the Huns or the Moors or the Goths.
  1781. "But we are modern!", we can cry. Modern enough to convict Columbus
  1782. and acquit Stalin. Modern enough to mourn the slaughter of the
  1783. indigenous Americans and the Maori but to forget entirely the
  1784. slaughter of the Kulaks, of the Jews, of the Gypsies, of the Chinese,
  1785. the Koreans, the Vietnamese and the Kampucheans. We are very modern
  1786. indeed. That primitive Torquemada could only murder innocent people
  1787. one at a time...
  1788.  
  1789. In Europe, Africa and Asia, they know it _can_ happen "here". In the
  1790. United States, it's awfully easy to forget that it _has_. The vicious
  1791. practices of Senator Joseph McCarthy were taken chapter and verse
  1792. from methods perfected in the late fifteenth century by Tom‡s de
  1793. Torquemada - though, being ignorant, McCarthy probably borrowed them
  1794. from the Communists he was excoriating.
  1795.  
  1796. And bear in mind, while our leaders are largely gutless, their
  1797. supporters are not. Whether in the name of "Decency" or "Political
  1798. Correctness", there is never any shortage of people with the
  1799. conviction that "infidels" with unpopular ideas should not be
  1800. suffered to exist and the courage to back that conviction by force of
  1801. arms.
  1802.  
  1803. "Decency" is fine thing. So are "Political Correctness" and
  1804. "Traditional Family Values" and "Respect For Alternative Lifestyles".
  1805. All fine ideas. But when we attempt to "persuade" others of their
  1806. value with a gun - or with a law, which is the Modern Couch-Potato's
  1807. Remote Control Gun - we have left entirely the realm of civilized
  1808. discourse and entered instead the jungle of barbarism and tyranny.
  1809. What starts as rowdiness and vandalism, if unchecked, ends at an
  1810. _auto de Fe_, at a forced march to the sea, at Treblinka...
  1811.  
  1812. Consider the irony: Torquemada killed people for refusing to renounce
  1813. their ideas in the name of a man who died rather than renounce his
  1814. ideas! I am not a Christian, but I find much to admire in the heroism
  1815. of the Nazarene. And nothing at all to admire in either Torquemada or
  1816. his So Very Modern successors. Our prized safety, our vaunted
  1817. comfort, our empty leisure - we owe these things to people who were
  1818. neither safe nor comfortable nor idle, who valued nothing ahead of
  1819. the convictions of their own minds, who feared nothing in the glare
  1820. of that bright-burning light. As we bring slander and torture and
  1821. exile and murder upon them, we bring poverty and tyranny upon
  1822. ourselves. This is the lesson that Ferdinand and Isabella learned too
  1823. late. If we cannot be _principled_, one may hope we are at least
  1824. smart enough to be "practical".
  1825.  
  1826. We would not be human if we did not seek desquite from ideas that
  1827. make us uneasy. But before we "Cry Havoc!", we would do well to see
  1828. just what kind of dogs we are unleashing. That man from Nazareth, the
  1829. last hero we suffer to stand, might be able to wash away our sins. It
  1830. seems unlikely that he can wash the blood of innocents from
  1831. Torquemada's hands. Or from our own...
  1832.  
  1833.  
  1834.  
  1835.  
  1836. APPENDIX C - BLATANT ADVERTISING
  1837.  
  1838. These are my currently shipping commercial products:
  1839.  
  1840. XP8 - a very intelligent file filter that cleans up and makes the
  1841. filthiest text QuarkXPress-ready. Among many other features, it offers
  1842. DOS-file reformatting, financial-text clean-up, garbage disposal,
  1843. typographic quality enhancement, and the best quote conversion we know
  1844. of. The demoware version of XP8 can be found under the name
  1845. XP8.SEA or in the Info-Mac archives as GST-XP8Demo.sit.
  1846.  
  1847. Torquemada The Inquisitor - batch global search and replace software
  1848. with wildcards, pattern matching, string substitution, et very
  1849. cetera. With Drag & Drop under Systems 7 or 8, you can run up to 640
  1850. searches on up to 128 files in one batch. Features the most
  1851. intelligent case-conversion we know of. The most-recent FreeWare
  1852. version (1.1.0) can be found under the name TORQUE.SEA in Library 5
  1853. or in the Info-Mac archives as GST-TorqueDemo.sit. The current
  1854. commercial version is 1.3.0, offering a great many enhancements,
  1855. including new "wildthings" and a _lot_ of new User Interface power.
  1856. The commercial version ships with Torquemada's Ghost, a scriptable,
  1857. backgroundable Torquemada. A DemoWare version of Torquemada's Ghost
  1858. is available as TGHOST.SEA in Library 5 or in the Info-Mac archives
  1859. as GST-TGhostDemo.sit.
  1860.  
  1861. Shane the Plane 2.0.2 - file and font attribute editing utility.
  1862. Interactively or in Drag & Drop batches, permits you to change the
  1863. Creator/Type of files, their created/modified dates and times, a
  1864. host of significant Finder flags, plus a lot more. Makes files
  1865. invisible/visible, makes fonts behave like files by removing their
  1866. BNDL resources, batch "pastes" custom icons, intelligently renames
  1867. and/or "slugs" files, et very cetera. A demonstration version (fully
  1868. functional but limited to 32 launches) can be found in Library 12
  1869. under the name SPDEMO.SEA or in the Info-Mac archives as
  1870. GSU-STPDemo.sit.
  1871.  
  1872. Mark My Words - a very elaborate MS-Word binary to QuarkXPress Tags
  1873. text filter. It eats Word 4.0, 5.0 or 5.1 files, interactively or by
  1874. Drag & Drop, and converts the binary to QuarkXPress tagged text. You
  1875. can elect to include or omit any feature of Word's styling, and many
  1876. features can be converted from their WP-like form to their DTP-like
  1877. form (e.g., underscoring to italic). With Em Software's Xtags
  1878. Xtension, picture and text boxes (including Word's tables) can be
  1879. retained. A demonstration version (fully functional but limited to
  1880. 32 launches) can be found in Library 12 under the name MMWDEM.SEA or
  1881. in the Info-Mac archives as GST-MMWDemo.sit.
  1882.  
  1883. (While I've vectored all the files toward CIS and the internet, my
  1884. primary haunt, they are also available on other services, and on any BBS
  1885. which has the most recent version of AMUG's BBS-In-A-Box CD-ROM on
  1886. line.)
  1887.  
  1888. All of these programs are sold on the same terms: (US)$50 each, per
  1889. license. Two to 10 licenses are $45 each. For 11 or more licenses you're
  1890. better off buying a site license. All of this is explained in the
  1891. registration software supplied with this archive.
  1892.